#include <bits/stdc++.h>
using namespace std;

const int N=1e5+10;
const int MAXMAX=1e6+7;
int n,ans;
bool fg=1;
int a[N];

int main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>n;
    ans=n;
    for(int i=1;i<=n;i++)
    {
        cin>>a[i];
        if(a[i]>2) fg=0;
    }
    if(fg)
    {
        ans=0;
        for(int i=1;i<=n;i++)
            if(a[i]==2)
                ans++;
        if(ans-n<ans)
            cout<<ans;
        else
            cout<<n-ans;
        return 0;
    }
    sort(a+1,a+n+1);
    for(int i=2;i<=n;i++)
    {
        if(a[i]<=a[i-1])
        {
            for(int j=1;j<i;j++)
            {
                if(a[i]>a[j])
                {
                    a[j]=MAXMAX;
                    ans--;
                    break;
                }
            }
        }
        else
        {
            a[i-1]=MAXMAX;
            ans--;
        }
    }
    cout<<ans;
    return 0;
}
